﻿using UnityEngine.Events;

namespace Anderson.PluginFramework
{
    public enum ServiceEventType
    {
        Register,
        UnRegister
    }

    public class ServiceEventArg
    {
        private ServiceEventType m_state;
        private IPlugin m_plugin;

        public ServiceEventType State
        {
            get
            {
                return m_state;
            }

            set
            {
                m_state = value;
            }
        }

        public IPlugin Plugin
        {
            get
            {
                return m_plugin;
            }

            set
            {
                m_plugin = value;
            }
        }

        public ServiceEventArg(ServiceEventType state, IPlugin plugin)
        {
            State = state;
            Plugin = plugin;
        }
    }

    [System.Serializable]
    public class ServiceEvent : UnityEvent<ServiceEventArg>
    {
    }
}